package com.carey.blog.framework.latke.repository;

/**
 * Transaction.
 * 
 */
public interface Transaction {

	/**
	 * Commits this transaction.
	 * 
	 * <p>
	 * <b>Throws</b>:<br/>
	 * {@link java.lang.IllegalStateException} - if the transaction has already
	 * been committed, rolled back
	 * </p>
	 */
	void commit();

	/**
	 * Rolls back this transaction.
	 * 
	 * <p>
	 * <b>Throws</b>:<br/>
	 * {@link java.lang.IllegalStateException} - if the transaction has already
	 * been committed, rolled back
	 * </p>
	 */
	void rollback();

	/**
	 * Determines whether this transaction is active.
	 * 
	 * @return {@code true} if this transaction is active, {@code false}
	 *         otherwise
	 */
	boolean isActive();
}
